import request from '@/utils/request.js'
import store from '../store'

// export const loginAPI = (username, password) => {
//   return request({
//     url: '/user/login',
//     method: 'post',
//     data: {
//       username: 'hzhmqd',
//       password: '123456'
//     }
//   })
// }
export const loginAPI = ({ username, password }) => {
  return request({
    url: '/user/login',
    method: 'post',
    data: {
      username,
      password
    }
  })
}
// export const getTokenAPI=({})
export const geiHousesList = () => {
  return request({
    url: '/houses',
    method: 'get',
    headers: {
      Authorization: store.state.token
    },
    params: {
    }
  })
}
export const swiper = (params) => {
  return request({
    url: '/home/swiper',
    method: 'GET',
    params
  })
}
// 获取城市列表数据api
export const getAreaAPI = () => {
  return request({
    url: '/area/city',
    method: 'get',
    params: {
      level: 1
    }
  })
}
// 获取城市列表数据api
export const selectHouseList = (id) => {
  return request({
    url: '/houses/condition',
    method: 'get',
    params: {
      id: id
    }
  })
}
